package com.hellobike.haxing.modules.wms.service.impl;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.hellobike.haxing.modules.wms.entity.Location;
import com.hellobike.haxing.modules.wms.mapper.LocationMapper;
import com.hellobike.haxing.modules.wms.service.ILocationService;
import org.springframework.stereotype.Service;

/**
 * @Description: t_wms_location
 * @Author: haxing-boot
 * @Date:   2020-01-13
 * @Version: V1.0
 */
@Service
public class LocationServiceImpl extends ServiceImpl<LocationMapper, Location> implements ILocationService {

    @Override
    public Location getByLocCodeAndWarehouseId(String toLocCode,Long warehouseId) {
        Location q = new Location();
        q.setLocCode(toLocCode);
        q.setWarehouseId(warehouseId);
        Wrapper<Location> wrapper = new QueryWrapper<>(q);
        return baseMapper.selectOne(wrapper);
    }
}
